package com.jinzihan.service.impl;

import com.jinzihan.dao.ManagerDao;
import com.jinzihan.dao.impl.ManagerDaoImpl;
import com.jinzihan.entity.Manager;
import com.jinzihan.service.ManagerService;

public class ManagerServiceImpl implements ManagerService {
    ManagerDao managerDao = new ManagerDaoImpl();
    @Override
    public Manager login(Manager manager) {
        return managerDao.queryManagerByUsernameAndPassword(manager.getUsername(),manager.getPassword());
    }

    @Override
    public boolean existsUsername(String username) {
        if (managerDao.queryManagerByUsername(username)==null){
            return false;
        }else {
            return true;
        }
    }
}
